#!/bin/bash

set -e

print_exit() {
  echo "Test failed" ${2}
  exit ${1}
}

HERE=$(pwd)
for tst in $(ls */test.sh)
do
  cd ${HERE}
  echo Testing ${tst}
  cd $(dirname ${tst})
  ./test.sh || print_exit 1 ${tst}
done

echo All tests passed
